#include "Bigram.h"
#include "iostream"
#include<vector>
#include<sstream>

std::vector<string> Bigram::findOcurrences(string text, string first, string second)
{
    istringstream record(text);
    string one, two, three;
    record >> one;
    record >> two;
    cout << "one = " << one << endl;
    cout << "two = " << two << endl;
    vector<string> ans;
    while (record >> three)
    {
        cout << "three = " << three << endl;
        if (one == first && two == second)
            ans.emplace_back(three);
        one = two;
        two = three;
    }
    return ans;
}